package org.osgifx.ui;

import javafx.scene.CustomNode;
import javafx.scene.Group;
import javafx.scene.Node;

import javafx.scene.layout.VBox;

import org.osgi.framework.Bundle;
import javafx.scene.control.Label;

/**
 * @author johan
 */

public class BundleOverview extends CustomNode {

  var bundleUI : BundleUI[];

  var title: Label = Label {
	text: "Bundle Overview"
}

  var bundlelist: VBox = VBox {
    translateY:60;
    translateX:20;
    content: bind bundleUI;
  };

  public function addBundle (bundle: Bundle) {
    var myBundleUI:BundleUI = BundleUI {
      name: bundle.getSymbolicName();
      status: bundle.getState();
    }
    insert myBundleUI into bundleUI;
  }

  override function create() : Node {

    Group {
      content: [title, bundlelist];
    }
  }

}
